package com.jk.controller;

import com.jk.dto.TemSending;
import com.jk.pojo.ResponseResult;
import com.jk.service.TemSendingServiceFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yzf
 * @version 1.0
 * @ClassName TemSendingController
 * @program: office
 * @description: TODO
 * @date 2025/2/18 9:52
 */
@Api(tags = "发送邮件")
@RestController
@RequestMapping("/sending")
public class TemSendingController {
    @Autowired
    private TemSendingServiceFeign temSendingServiceFeign;

    @ApiOperation(value = "发送邮件",httpMethod = "POST",notes = "发送邮件")
    @RequestMapping("/addSending")
    public ResponseResult addSending(@RequestBody TemSending temSending){
        try {
            temSendingServiceFeign.addSending(temSending);
            return new ResponseResult(200,"发送成功");
        } catch (Exception e) {
            e.printStackTrace();
            return new ResponseResult(500,"发送失败");

        }
    }
}
